'use strict';

var app = angular.module('app', ['ngResource', 'ngRoute']);

app.config(function ($routeProvider, $locationProvider) {
    $routeProvider.when('/',
        {
            templateUrl: '/app/templates/articles.html',
            controller: 'articlesController'
        });

    $routeProvider.when('/articles/:id',
    {
        templateUrl: '/app/templates/articleDetails.html',
        controller: 'articleDetailsController'
    });

    $routeProvider.when('/searchResults',
     {
         templateUrl: '/app/templates/searchResults.html',
         controller: 'searchResultsController'
     });

    $routeProvider.otherwise({ redirectTo: '/' });
    $locationProvider.html5Mode(true);
});